<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	<style type="text/css">
		body, html {width: 100%;height: 100%;margin:0;font-family:"微软雅黑";}
		#allmap{width:300px;height:300px;}
	</style>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=d58ZSK69SEKylXqloWyLZAAj3UF9Ax2C"></script>
	<title>缩放地图</title>
</head>
<body>
	<div id="allmap"></div>
	
</body>
</html>
<script type="text/javascript">
	// 百度地图API功能
			var map = new BMap.Map("allmap");  

			var pt = new BMap.Point(117.129458, 24.402142);//获取经度纬度
			
			map.centerAndZoom(pt, 13);//14代表地图显示的层级，越高代表越大
			map.enableScrollWheelZoom();//启用滚轮放大缩小，默认禁用
			map.enablePinchToZoom()
			var myIcon = new BMap.Icon("miaov.png", new BMap.Size(30,30));
			var marker2 = new BMap.Marker(pt,{icon:myIcon});  // 创建标注
			map.addOverlay(marker2); 
			
			var opts = {
			  width : 200,     // 信息窗口宽度
			  height: 60,     // 信息窗口高度
			  title : "高峰谷度假酒店"  // 信息窗口标题
			}
			var infoWindow = new BMap.InfoWindow("集集小筑", opts);  // 创建信息窗口对象
			map.openInfoWindow(infoWindow,pt); //开启信息窗口 
			setTimeout(function(){
				map.setZoom(14);   
			}, 2000);  //2秒后放大到14级
//			map.enablePinchToZoom();
			map.enableDoubleClickZoom();

</script>
